<?php
require('../config.php');

		$cart_list=$_REQUEST['cart_list'];
		$goods_list=explode(',',$cart_list);
		for($i=0;$i<count($goods_list);$i++)
		{
			$lin=0;
			$lin=explode('_',$goods_list[$i]);
			$goodsId_list[$i]=$lin[0];
			if(count($lin)>1) $num_list[$i]=$lin[1];
		}
		$t=0;
		for($i=0;$i<count($goodsId_list);$i++)
		{
			$sql="select s.id,s.sid,s.shop_id,s.title,s.qishu,s.thumb,s.canyurenshu,s.zongrenshu,s.shenyurenshu,s.yunjiage from `".$oto."_shoplist` as s where `q_user_code` is null and id='".$goodsId_list[$i]."'";
			$result=$db->query($sql);
			while($row=$result->fetch_assoc()){
				$shoplist[$i]=$row;//将取得的所有数据赋值给person_info数组
			}
			if(isset($shoplist[$i]))
			{
				if(isset($num_list)) $shoplist[$i]['orderCount']=$num_list[$i];
				//$shoplist[$i]['yunjiage']=1;//强制更改单次价格为1元
				$sid=$shoplist[$i]['sid'];
				//获取期数
				$sql="select s.qishu from `".$oto."_shoplist` as s where sid='{$sid}' order by qishu desc limit 1";
				$result=$db->query($sql);
				while($row=$result->fetch_assoc()){
					$qishu_info=$row;
				}
				if(isset($qishu_info)) $shoplist[$i]['max_qishu']=$qishu_info['qishu'];
				else $shoplist[$i]['max_qishu']="";
				$data[$t]=$shoplist[$i];
				$t++;
			}
		}
		if(isset($data)) echo json_encode($data);
		else echo '[]';
?>